﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StuMana.Services
{
    class Devices
    {
        public string _ipState;
        public string _ipDymate;
        public string _gateName;

        public Devices()
        {
            _ipState = "";
            _ipDymate="";
            _gateName ="";
        }

        public Devices(string ipState, string ipDymate, string gateName)
        {
            _ipState = ipState;
            _ipDymate = ipDymate;
            _gateName = gateName;
        }


        public bool CheckInList(List<Devices> li )
        {
            bool kq = false;
            for (int i = 0; i < li.Count; i++)
            {
                if (li[i]._ipState == this._ipState || li[i]._ipDymate == this._ipDymate)
                    return true;
            }
             return kq;
        }


        public  Devices GetHostName( List<Devices> li)
        {
           
            for (int i = 0; i < li.Count; i++)
            {
                if (li[i]._ipState == this._ipState || li[i]._ipDymate == this._ipDymate)
                {
                    this._gateName = li[i]._gateName;
                    return this;
                }
            }
            return this;
        }




    }
    
}
